<?php
declare (strict_types = 1);

namespace app\home\model;
use think\Model;

/**
 * @mixin \think\Model
 */
class pyg_user extends Model
{
    public function addUser($data)
    {
        return $this->save($data);
    }
    public function loginUser($data)
    {
        $data = $this->where('phone|email|username',$data['username'])->find();
        if($data)
        {
            return $data;
        }
        return false;
    }
    public function showUser($openid)
    {
        return $this->where('open_type','qq')->where('openid',$openid)->find();
    }
    public function updates($data,$openid)
    {
        return $this->where('openid',$openid)->update($data);
    }
    public function addPin($info,$openid)
    {
        return $this->create(['open_type'=>'qq','openid'=>$openid,'nickname'=>$info['nickname']]);
    }







}
